package edu.cibertec.sicsolutions.servlet;

import java.net.URL;

import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.PropertyConfigurator;

import edu.cibertec.sicsolutions.vfs.spring.SpringContext;

public class ServletInicializate extends HttpServlet implements Servlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 66458264740607205L;

	public void init() throws ServletException {
		String prefix =  getServletContext().getRealPath("/");
		String file = getInitParameter("log4j-init-file");		
	 	try{
			SpringContext.getContext();			
	 		PropertyConfigurator.configure(prefix+file);			  
		}catch (Exception e){
			System.out.println(e.getMessage());		
		}
		super.init();
	}

	public void destroy() {
		super.destroy();
	}
}
